﻿namespace IDal
{
    /// <summary>
    /// 公共接口方法
    /// </summary>
    /// <typeparam name="T">泛型方法</typeparam>
    public interface IBaserDal<T>
    {

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="t">数据信息</param>
        /// <returns>返回值受影响行数</returns>
        Task<int> AddAnync(T t);

        /// <summary>
        /// 批量新增
        /// </summary>
        /// <param name="t">数据信息</param>
        /// <returns>返回值受影响行数</returns>
        Task<int> AddRangeAnync(List<T>list);



        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="t">数据信息</param>
        /// <returns>返回值受影响行数</returns>
        Task<int> DeleteAnync(T t);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="t">数据信息</param>
        /// <returns>返回值受影响行数</returns>
        Task<int> DeleteRangeAnync(List<T> list);

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="t">数据信息</param>
        /// <returns>返回值受影响行数</returns>
        Task<int> UpdateAnync(T t);

        /// <summary>
        /// 批量修改
        /// </summary>
        /// <param name="t">数据信息</param>
        /// <returns>返回值受影响行数</returns>
        Task<int> UpdateRangeAnync(List<T> list);

        /// <summary>
        /// 延迟（查询）
        /// </summary>
        /// <returns>返回值受影响行数</returns>
        IQueryable<T> GetValues();
    }
}
